package com.cec.mapper.admin;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cec.dto.ActivityDTO;
import com.cec.dto.CategoryDTO;
import com.cec.entity.Activity;
import com.cec.vo.HomeDataVO;
import com.cec.vo.CategoryVO;
import com.cec.vo.ActivityVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 活动表 Mapper 接口
 * </p>
 *
 * @author lt
 * @since 2024-10-25
 */
public interface ActivityMapper extends BaseMapper<Activity> {
    /**
     * 分页查询
     * @param objectPage
     * @param wrapper
     * @return
     */
    IPage<ActivityVO> pageQueryActivity(Page<Object> objectPage, @Param(Constants.WRAPPER) QueryWrapper<ActivityDTO> wrapper);

    /**
     * 获取活动类型
     * @return
     */
    @Select("select id,type_name name from activity_type;")
    List<CategoryVO> queryActivityTypeList();

    List<HomeDataVO> getHomeInfoData(@Param(Constants.WRAPPER) QueryWrapper<Activity> wrapper);

    /**
     * 分页查询活动类型
     * @param objectPage
     * @return
     */
    @Select("select id,type_name name from activity_type   ${ew.customSqlSegment}")
    IPage<CategoryVO> pageQueryActivityType(Page<Object> objectPage,@Param(Constants.WRAPPER) QueryWrapper<CategoryDTO> wrapper);


    //List<ActivityVO> getPageQueryActivityList(Page<ActivityDTO> page);
}
